package bfgca;
import java.awt.*;
import javax.swing.*;
import java.util.*;


public class VesselComponent extends JTabbedPane{

  public VesselComponent(){
    this.setPreferredSize(new Dimension (200, 200));
    ArrayList<Vessel> testList = new ArrayList<Vessel>();
    for(int i = 0; i < 10; i++){
      testList.add(new Vessel(25, Vessel.Type.HeavyTransport, "Vessel"+i));
    }
//    this.addTab("Orders", new VesselList(testList));
    this.addTab("Orders", new JScrollPane(new List(testList)));
    this.addTab("Ship Yard", new JScrollPane(new List(testList)));
  }
  
  private class List extends JPanel{
    
    private String name;
    
    public List(ArrayList<Vessel> vessels){
      this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
      for(int i = 0; i < vessels.size(); i++){
        JPanel entry = new JPanel(new GridLayout(1, 3));
        entry.add(new JLabel(vessels.get(i).toString()));
        entry.add(new JComboBox());
        entry.add(new JComboBox());
        this.add(entry);
        
      }
    }
  }
  
}
